package com.kun.admin.authority.controller;

import com.kun.admin.authority.service.CacheService;
import com.kun.base.web.model.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by likun on 2017/8/12.
 */
@Controller
@RequestMapping("/admin/cache")
public class AdminCacheController {

    @Autowired
    private CacheService cacheService;

    /**
     * 删除所有的权限缓存
     * @return
     */
    @RequestMapping("/clearPermission")
    @ResponseBody
    public AjaxResult clearPermission(){
        cacheService.clearPermission();
        return new AjaxResult(true);
    }
}
